package org.example;

/**
 * @author: knowno
 * @create: 2025-09-09 13:58
 * @Version 1.0
 **/
public class TestBasicDataTypeCompare {
    public static void main(String[] args) {

        // == 运算符,基本类型来说,比较的是两个变量中存储数据的大小是否相等,以二进制为准


        //比较double和float类型
        double d1 = 0.25;
        float f1 = 0.25f;
        System.out.println(d1 == f1);

        System.out.println("*******************************");

        double d2 = 0.3;
        float f2 = 0.3f;
        System.out.println(d2 == f2);

        System.out.println("*******************************");

        //boolean类型结果
        System.out.println(0.1+0.2 == 0.3);
        System.out.println(0.1+0.2 == 0.3f);
        System.out.println(0.1f+0.2f == 0.3f);
        //https://0.30000000000000004.com/


    }
}
